package com.boang.daemon;

import java.io.IOException;

/*
    @author:sa
    @date:2024/11/28 11:39
*/
public class DaemonDemo extends Thread{
    @Override
    public void run(){
        for (int i = 0; i < 10000; i++) {
            try {
                Thread.sleep(1000000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName()+":"+i);
        }
    }

    public static void main(String[] args) throws IOException {
        DaemonDemo daemonDemo = new DaemonDemo();
        daemonDemo.setDaemon(true);
        daemonDemo.start();
        System.in.read();
    }
}